package com.sk.weichat.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

/**
 * @Author: chenzl
 * @ClassName: DynamicLoactionBean
 * @Description: java类作用描述
 * @CreateDate: 2019/10/24 10:36
 */
public class DynamicLoactionBean {

    private List<LoactionResult> results;
    private int total;
    private String message;
    int status;

    public List<LoactionResult> getResults() {
        return results;
    }

    public void setResults(List<LoactionResult> results) {
        this.results = results;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public static class LoactionResult implements Parcelable{
        /**
         * area : 青秀区
         * uid : 4598c0adb0515c7af90cad64
         * address : 广西壮族自治区南宁市青秀区滨湖路80号
         * province : 广西壮族自治区
         * city : 南宁市
         * detail_info : {"detail_url":"http://api.map.baidu.com/place/detail?uid=4598c0adb0515c7af90cad64&output=html&source=placeapi_v2","distance":1163,"navi_location":{"lng":108.37719826805,"lat":22.832598125841},"children":[],"tag":"政府机构;行政单位","type":"life","image_num":"6"}
         * name : 南宁市不动产登记局青秀受理点
         * location : {"lng":108.377232,"lat":22.832719}
         * detail : 1
         * street_id : 4598c0adb0515c7af90cad64
         */

        private String area;
        private String uid;
        private String address;
        private String province;
        private String city;
        private DetailInfoBean detail_info;
        private String name;
        private LocationBean location;
        private int detail;
        private String street_id;


        public LoactionResult(Parcel in) {
            area = in.readString();
            uid = in.readString();
            address = in.readString();
            province = in.readString();
            city = in.readString();
            detail_info = in.readParcelable(DetailInfoBean.class.getClassLoader());
            name = in.readString();
            location = in.readParcelable(LocationBean.class.getClassLoader());
            detail = in.readInt();
            street_id = in.readString();
        }

        public static final Creator<LoactionResult> CREATOR = new Creator<LoactionResult>() {
            @Override
            public LoactionResult createFromParcel(Parcel in) {
                return new LoactionResult(in);
            }

            @Override
            public LoactionResult[] newArray(int size) {
                return new LoactionResult[size];
            }
        };

        public LoactionResult() {

        }

        public String getArea() {
            return area;
        }

        public void setArea(String area) {
            this.area = area;
        }

        public String getUid() {
            return uid;
        }

        public void setUid(String uid) {
            this.uid = uid;
        }

        public String getAddress() {
            return address;
        }

        public void setAddress(String address) {
            this.address = address;
        }

        public String getProvince() {
            return province;
        }

        public void setProvince(String province) {
            this.province = province;
        }

        public String getCity() {
            return city;
        }

        public void setCity(String city) {
            this.city = city;
        }

        public DetailInfoBean getDetail_info() {
            return detail_info;
        }

        public void setDetail_info(DetailInfoBean detail_info) {
            this.detail_info = detail_info;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public LocationBean getLocation() {
            return location;
        }

        public void setLocation(LocationBean location) {
            this.location = location;
        }

        public int getDetail() {
            return detail;
        }

        public void setDetail(int detail) {
            this.detail = detail;
        }

        public String getStreet_id() {
            return street_id;
        }

        public void setStreet_id(String street_id) {
            this.street_id = street_id;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel var1, int flags) {
            var1.writeString(area);
            var1.writeString(uid);
            var1.writeString(address);
            var1.writeString(province);
            var1.writeString(city);
            var1.writeParcelable(detail_info, flags);
            var1.writeString(name);
            var1.writeParcelable(location, flags);
            var1.writeInt(detail);
            var1.writeString(street_id);
        }

        public static class DetailInfoBean implements Parcelable{
            /**
             * detail_url : http://api.map.baidu.com/place/detail?uid=4598c0adb0515c7af90cad64&output=html&source=placeapi_v2
             * distance : 1163
             * navi_location : {"lng":108.37719826805,"lat":22.832598125841}
             * children : []
             * tag : 政府机构;行政单位
             * type : life
             * image_num : 6
             */

            private String detail_url;
            private int distance;
            private LocationBean navi_location;
            private String tag;
            private String type;
            private String image_num;
//            private List<?> children;

            public DetailInfoBean() {

            }

            protected DetailInfoBean(Parcel in) {
                detail_url = in.readString();
                distance = in.readInt();
                tag = in.readString();
                type = in.readString();
                image_num = in.readString();
            }

            public static final Creator<DetailInfoBean> CREATOR = new Creator<DetailInfoBean>() {
                @Override
                public DetailInfoBean createFromParcel(Parcel in) {
                    return new DetailInfoBean(in);
                }

                @Override
                public DetailInfoBean[] newArray(int size) {
                    return new DetailInfoBean[size];
                }
            };

            public String getDetail_url() {
                return detail_url;
            }

            public void setDetail_url(String detail_url) {
                this.detail_url = detail_url;
            }

            public int getDistance() {
                return distance;
            }

            public void setDistance(int distance) {
                this.distance = distance;
            }

            public LocationBean getNavi_location() {
                return navi_location;
            }

            public void setNavi_location(LocationBean navi_location) {
                this.navi_location = navi_location;
            }

            public String getTag() {
                return tag;
            }

            public void setTag(String tag) {
                this.tag = tag;
            }

            public String getType() {
                return type;
            }

            public void setType(String type) {
                this.type = type;
            }

            public String getImage_num() {
                return image_num;
            }

            public void setImage_num(String image_num) {
                this.image_num = image_num;
            }

          /*  public List<?> getChildren() {
                return children;
            }

            public void setChildren(List<?> children) {
                this.children = children;
            }
*/
            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(detail_url);
                dest.writeInt(distance);
                dest.writeString(tag);
                dest.writeString(type);
                dest.writeString(image_num);
            }

        }

        public static class LocationBean implements Parcelable{
            /**
             * lng : 108.377232
             * lat : 22.832719
             */

            private double lng;
            private double lat;

            public LocationBean(){

            }
            protected LocationBean(Parcel in) {
                lng = in.readDouble();
                lat = in.readDouble();
            }

            public static final Creator<LocationBean> CREATOR = new Creator<LocationBean>() {
                @Override
                public LocationBean createFromParcel(Parcel in) {
                    return new LocationBean(in);
                }

                @Override
                public LocationBean[] newArray(int size) {
                    return new LocationBean[size];
                }
            };

            public double getLng() {
                return lng;
            }

            public void setLng(double lng) {
                this.lng = lng;
            }

            public double getLat() {
                return lat;
            }

            public void setLat(double lat) {
                this.lat = lat;
            }

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeDouble(lng);
                dest.writeDouble(lat);
            }
        }

    }

}
